package com.qysoft.dtkj.dtkj_gl.actions.cjgl;

import java.util.HashMap;

import com.jfinal.aop.Before;
import com.qysoft.dtkj.dtkj_gl.services.cjgl.CJGLService;
import com.qysoft.rapid.actions.JsonResultInterceptor;
import com.qysoft.rapid.actions.RapidAction;
import com.qysoft.rapid.core.RapidDbConn;
import com.qysoft.rapid.core.RapidDbConnTx;
import com.qysoft.rapid.domain.Bean;

/**
 * 采集管理action
 * @author Administrator
 *
 */
public class CJGLAction extends RapidAction{

	public void cjszIndex(){
		renderJsp("/WEB-INF/pages/cjgl/cjsz.jsp");
	}

	@Before(value={JsonResultInterceptor.class,RapidDbConnTx.class})
	public void saveCJXX() throws Exception{
		HashMap<String, Object> parameters = (HashMap<String, Object>) getParams();
		CJGLService.saveCJXX(parameters);
	}

	@Before(value={JsonResultInterceptor.class,RapidDbConnTx.class})	
	public void updateIsCap() throws Exception{
		String isCap = getPara("isCap");
		String capId = getPara("capId");
		CJGLService.updateIsCap(isCap, capId);
	}
	
	@Before(value={JsonResultInterceptor.class,RapidDbConnTx.class})	
	public void deleteCJXX() throws Exception{
		String capId = getPara("capId");
		CJGLService.deleteCJXX(capId);
	}
	 
	/**
	 * 跳转到税源企业页面
	 */
	public void syqyIndex() {
		renderJsp("/WEB-INF/pages/cjgl/syqy.jsp");
	}
	
	/**
	 * 查询税源企业信息
	 * @throws Exception
	 */
	@Before({JsonResultInterceptor.class, RapidDbConn.class})
	public void querySyqy() throws Exception {
		long qyid = getParaToInt("qyid");
		Bean qyxx = CJGLService.querySyqy(qyid);
		setJson(qyxx);
	}
	
	/**
	 * 添加税源企业信息
	 * @throws Exception
	 */
	@Before({JsonResultInterceptor.class, RapidDbConnTx.class})
	public void addSyqy() throws Exception {
		Bean qyxx = getBean();
		CJGLService.addSyqy(qyxx);
	}
	
	/**
	 * 修改税源企业信息
	 * @throws Exception
	 */
	@Before({JsonResultInterceptor.class, RapidDbConnTx.class})
	public void updateSyqy() throws Exception {
		Bean qyxx = getBean();
		CJGLService.updateSyqy(qyxx);
	}
	
	/**
	 * 删除税源企业信息
	 * @throws Exception
	 */
	@Before({JsonResultInterceptor.class, RapidDbConn.class})
	public void deleteQyxx() throws Exception {
		long qyid = getParaToInt("qyid");
		CJGLService.deleteSyqyxx(qyid);
	}
}
